
	<h1><?php echo $this->lang->line('testimonial_title'); ?></h1>
	<form action="<?php echo admin_url();?>/testimonials/search-results" method="post">
	    <div class="toppage">
	    	<span class="left">
	        	<select style="width: 130px;" id="action">
	            	<option value=""><?php echo $this->lang->line('choose_action'); ?></option>                               
	                <option value="active"><?php echo $this->lang->line('active'); ?></option>
	                <option value="suspend"><?php echo $this->lang->line('suspend'); ?></option>
	                <option value="delete"><?php echo $this->lang->line('delete'); ?></option>
	            </select>
	            <input onclick="$('[name=action]').val($('#action').val()); $('#action_testimonials_form').submit()" value="<?php echo $this->lang->line('apply'); ?>" class="btn" type="button">
	       		<input type="text" name="search" onfocus="if (this.value == 'Keyword') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Keyword';}"  value="Keyword" style="width:165px; padding:3px;" />
	        	<input type="submit" name="" value="<?php echo $this->lang->line('search'); ?>" class="btn" />
	        </span>
	        
	        <span class="btnadd">
                <a onclick="open_form('<?php echo admin_url(); ?>/add-new-testimonial')" href="javascript:void(0)"><?php echo $this->lang->line('add'); ?></a>
            </span>
	    </div>
	</form>    
	<form action="<?php echo admin_url();?>/testimonials/" method="post" id="list-testimonials-form">
	    <div class="topart">
	    	<span class="left">
	    		<?php 
	    			$total_amount	=	count($this->testimonials_model->get_all());
	    			$active			=	$this->testimonials_model->count_active();
	    		?>
	    		<font class="number">(<?php if ($total_amount >0) {echo $total_amount;}else {echo "0";}?>)</font> <a href="javascript:;"><?php echo $this->lang->line('all'); ?></a><font class="line">|</font><font class="number">(<?php if (count($active)>0) {echo $active;}else {echo "0";}?>)</font> <a href="javascript:;"><font color="#0b9901"><?php echo $this->lang->line('active'); ?></font></a><font class="line">|</font><font class="number">(<?php echo $total_amount - $active;?>)</font> <a href="javascript:;"><font color="#c60001"><?php echo $this->lang->line('pending'); ?></font></a><font class="line">
	        </span>
	        <span class="right1">
	        	<select style="width:50px;" name="perpage" id="perpage" onchange="changeTestimonialsNumber()">
	            	<option value="6" <?php echo ($current_perpage==6)?'selected':'';?>>6</option>
	                <option value="12" <?php echo ($current_perpage==12)?'selected':'';?>>12</option>
	                <option value="24" <?php echo ($current_perpage==24)?'selected':'';?>>24</option>
	                <option value="all" <?php echo ($current_perpage=='all')?'selected':'';?>><?php echo $this->lang->line('all'); ?></option>
	            </select>
	            <div class="pagination">
	                <?php if(isset($pagination)){echo $pagination;}?>
	            </div>
	        </span>
	        
	    </div>
	</form>
    <div class="tableout">
    	<form action="<?php echo admin_url();?>/testimonials/do-action" method="post" id="action_testimonials_form">
			<div class="title1">
	        	<div class="column" style="width: 2%;"><input class="check_all" onclick="check_all('.check_all')" type="checkbox"></div>
	            <div class="column" style="width: 4%;"><?php echo $this->lang->line('number'); ?></div>
	            <div class="column" style="width: 20%;"><?php echo $this->lang->line('name'); ?></div>
	            <div class="column" style="width: 30%;"><?php echo $this->lang->line('content'); ?></div>
	            <div class="column" style="width: 13%;"><?php echo $this->lang->line('country'); ?></div>
	            <div class="column" style="width: 10%;"><?php echo $this->lang->line('rating'); ?></div>
	            <div class="column" style="width: 16%;"><?php echo $this->lang->line('date'); ?></div>
	            <div class="column" style="width: 5%;"><?php echo $this->lang->line('status'); ?></div>
	        </div>
	        <?php if(count($testimonials_list[0])>0){?>
	        <?php foreach ($testimonials_list as $k => $v){?>
	        <div class="linecate2">
	        	<div class="column" style="width: 2%;"><input name="id[]" value="<?php echo $v->id;?>" type="checkbox" /></div>
	            <div class="column" style="width:4%;"><?php $pagin	=	$this->uri->segment(3); if(isset($pagin)){echo $k+1+$pagin;}?></div>
	          
	            <div id="row_<?php echo $v->id;?>">
		            <div class="column" style="width:20%;" onmouseover="Hovercat('<?php echo $v->id;?>')" onmouseout="Outcat('<?php echo $v->id;?>')">
		            	<a href="javascript:;" class="art ">
		            		<?php echo $v->name;?>
		            	</a><br />
		                <div class="action" id="neocat-<?php echo $v->id;?>">
		                    <img src="<?php echo base_url();?>public/admin/img/edit.gif" /><a href="javascript:void(0)" onclick="open_form('<?php echo admin_url(); ?>/edit-testimonials/<?php echo $v->id;?>')"><?php echo $this->lang->line('edit'); ?></a>|<img src="<?php echo base_url();?>public/admin/img/delete.gif" /><a href="<?php echo admin_url();?>/delete-testimonials/<?php echo $v->id;?>" onclick="return confirm('<?php echo $this->lang->line('delete_conf'); ?>');"><font color="#be0000"><?php echo $this->lang->line('delete'); ?></font></a>
		                </div>
		            </div>
		            <div class="column" style="width:30%;">
		            	<span style="color: green; font-family:inherit; font-style: italic; ">
		            		<?php 
		            			$content = $v->content;
		            			$content = strip_tags($content);
		            			if(strlen($content) > 60){
		            				$content = substr($content,0,60);
		            				$posw=strrpos($content," ");
		            				if($posw > 0)$content = substr($content,0,$posw);
		            				echo $content.'...';
		            			}else {
		            				echo $content;
		            			}
		            		?>
	            		</span>
		            </div>
		            <div class="column " style="width:13%; color: grey;"><?php echo $v->country;?></div>
		            <div class="column " style="width:10%; padding: 5px 0 0 0;">
		            	<?php for($i =1; $i <= 5; $i ++){ if($v->rating == $i){?>
		            		<img alt="" src="<?php echo base_url();?>public/admin/img/<?php echo $i.'_star_small.gif';?>">
		            	<?php }}?>
		            </div>
		            <div class="column " style="width:16%; color: grey;"><?php echo $v->time;?></div>
		            <div class="column" style="width:5%;">
		            <?php if($v->active == 'yes'){?>
		            	<a href="javascript:void(0);" onclick="testimonials_status('<?php echo $v->id;?>', 'no', '<?php echo $this->lang->line('status_mess'); ?>')"><img src="<?php echo base_url();?>public/admin/img/active.png" title="<?php echo $this->lang->line('active'); ?>" alt="Yes" class="icon png" /></a>
					<?php }else{?>		            	
		            	<a href="javascript:void(0);" onclick="testimonials_status('<?php echo $v->id;?>', 'yes', '<?php echo $this->lang->line('status_mess'); ?>')"><img src="<?php echo base_url();?>public/admin/img/pending.png" title="<?php echo $this->lang->line('suspend'); ?>" alt="No" class="icon png" /></a>
		            <?php }?>
		            </div>
	            </div>
	        </div>
	        <?php }?>
	        <?php }else{?>
	        	<p style="padding: 10px;font-size: 16px; font-style: italic; color: green;" ><?php echo $this->lang->line('no_results'); ?></p>
	        <?php }?>
	        <div class="bottom1">
	        	<div class="column" style="width: 2%;"><input class="check_all" onclick="check_all(this)" type="checkbox"></div>
	            <div class="column" style="width:50%;">
	            	<select style="width:130px;" name="action">
	                   	<option value=""><?php echo $this->lang->line('choose_action'); ?></option>                               
                		<option value="active"><?php echo $this->lang->line('active'); ?></option>
                		<option value="suspend"><?php echo $this->lang->line('suspend'); ?></option>
                		<option value="delete"><?php echo $this->lang->line('delete'); ?></option>
	                </select>
	                <input type="submit" name="" value="<?php echo $this->lang->line('apply'); ?>" class="btn" />
	            </div>
	            <span class="right1">
	                <div class="pagination">
	                <?php if(isset($pagination)){echo $pagination;}?>
	            </div>
	            </span>
	        </div>
        </form>
	</div>
	
<script type="text/javascript">
	function changeTestimonialsNumber(){
		$("#list-testimonials-form").submit();
	}

	var inform	=	'<?php echo $inform;?>';
	
	if(inform == 'delete testimonials success') {alert("<?php echo $this->lang->line('delete_mess'); ?>");}

	$('#action_testimonials_form').iframer({
	    onComplete: function(msg){
	    	if(msg == 'yes') {
		    	alert('<?php echo $this->lang->line('action_mess'); ?>');
	    		window.location	=	'<?php echo $current_url;?>';
	    	}
	    	else show_error('div_message', msg)
	    }
	});
</script>


	